<?
$r = "../";
require_once($r."_engine/header_nocache.php");
require_once($r."_engine/types.php");
require_once($r."_engine/c_table_editor_emails_templates.php");

$title = "Edit E-mail Template";
include "_header.php";


if (@$todo == "add") 
{
	$et = new CEmailTemplate();
	$et->InitNew();
	$data = $et->data;
}
else 
{
	$data = $te_em_tpl->GetDataForEdit();
	$todo = "update";
}
?>

<form action="emails_templates_process.php" method="post" name="f">
<input type="Hidden" name="todo" value="<?=@$todo?>">
<input type="Hidden" name="id" value="<?=@$data["id"]?>">

<table cellspacing="5" cellpadding="0" style="margin-left: 5;">
<tr>
	<td colspan="2" class="tdH">General</td>
</tr>
<tr>
	<td><span class="text">ID:</span></td>
	<td><span class="textStd"><?=@$data["id"]?></span></td>
</tr>
<tr>
	<td><span class="text">Template Name:</span></td>
	<td><span class="textStd"><input type="Text" name="f_template_name" value="<?=htmlspecialchars(@$data["template_name"])?>" style="width:230" 
		class="input2" class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'"></span></td>
</tr>
<tr>
	<td><span class="text">Email From:</span></td>
	<td><span class="textStd"><input type="Text" name="f_email_from" value="<?=htmlspecialchars(@$data["email_from"])?>" style="width:230" 
		class="input2" class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'"></span></td>
</tr>
<tr>
	<td><span class="text">Email To:</span></td>
	<td><span class="textStd"><input type="Text" name="f_email_to" value="<?=htmlspecialchars(@$data["email_to"])?>" style="width:230" 
		class="input2" class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'"></span></td>
</tr>
<tr>
	<td><span class="text">Email CC:</span></td>
	<td><span class="textStd"><input type="Text" name="f_email_cc" value="<?=htmlspecialchars(@$data["email_cc"])?>" style="width:230" 
		class="input2" class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'"></span></td>
</tr>
<tr>
	<td><span class="text">Email BCC:</span></td>
	<td><span class="textStd"><input type="Text" name="f_email_bcc" value="<?=htmlspecialchars(@$data["email_bcc"])?>" style="width:230" 
		class="input2" class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'"></span></td>
</tr>
<tr>
	<td><span class="text">Email Subject:</span></td>
	<td><span class="textStd"><input type="Text" name="f_email_subject" value="<?=htmlspecialchars(@$data["email_subject"])?>" style="width:230" 
		class="input2" class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'"></span></td>
</tr>

<tr>
	<td colspan="2" valign="top">
		<span class="textStd"><textarea rows="20" name="f_template_text"
			style="width: 700;" class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'"
			><?=htmlspecialchars(@$data["template_text"])?></textarea></td>
</tr>

<tr>
	<td colspan="2" valign="top"><span class="textStd">
		To send test message fill in e-mail address in the <b>To</b> field.
	</td>
</tr>


<tr><td colspan="2">&nbsp;</td></tr>
<tr>
	<td colspan="2" align="right"><span class="textStd">
		<input type="Button" value="Send Test" style="width: 150;" class="button2" onMouseOver="this.className='button2_act'" onMouseOut="this.className='button2'"
			onClick="document.f.todo.value='send_test'; document.f.submit();">
		<input type="Submit" value="Save" style="width: 150;" class="button2" onMouseOver="this.className='button2_act'" onMouseOut="this.className='button2'">
	</td>
</tr>
</table>
</form>


<?
include "_footer.php";
?>
